using Microsoft.Xna.Framework;

namespace GameStateManagement.Model.Entities
{
    /// <summary>
    /// Entity with properties for moving.
    /// </summary>
    public class MovingEntity : EntityBase
    {
        #region Constructors
        public MovingEntity()
        {

        }

        public MovingEntity(Vector2 position, Vector2 facing, string textureName, Color color, Vector2 scale, float mass)
            : base(position, facing, textureName, color, scale)
        {
            Mass = mass;
        }

        #endregion

        #region Fields

        #endregion

        #region Properties

        public float Mass { get; set; }
        public Vector2 Velocity { get; set; }

        #endregion

        #region Public Methods
        public override void Update(GameTime gameTime)
        {
            Position = Vector2.Add(Velocity, Position);
        }

        public void ApplyForceResultant(Vector2 resultant)
        {
            Velocity = Vector2.Add(Velocity, resultant);
        }

        #endregion
    }
}
